package cn.laixueit.controller;

import cn.laixueit.pojo.Student;
import cn.laixueit.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/findall")
    @ResponseBody
    public List<Student> findAll(){
        System.out.println("findAll....");
        return studentService.findAll();
    }
}
